import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/pages/news/main/models/news.dart';
import 'package:industry_net/pages/news/main/views/content/video/video_view.dart';

import '../controller.dart';

class VideoCell extends StatelessWidget {
  VideoCell({Key? key, required this.md}) : super(key: key);
  final NewsModel md;
  final controller = Get.find<ContentController>();
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () => controller.actionCellClick(md),
      child: Container(
        padding: EdgeInsets.symmetric(horizontal: gap12, vertical: gap10),
        child: Column(
          children: [
            Container(
              width: double.infinity,
              height: 150.r,
              decoration: BoxDecoration(
                  image: DecorationImage(
                    image: loadImageProvider(
                        url:
                            'https://pics4.baidu.com/feed/241f95cad1c8a7867a8dba7ef8706a3471cf509a.jpeg?token=243d92f5603d4043ff32595bb963c5ad'),
                    fit: BoxFit.cover,
                  ),
                  borderRadius: BorderRadius.circular(circle4)),
              child: Stack(
                children: [
                  Center(
                    child: loadImage(
                        url: 'icon_pause.png'.imgPathNews,
                        width: 36.r,
                        height: 36.r),
                  ),
                  Positioned(
                    bottom: 10.r,
                    width: Get.width - 4 * gap12,
                    child: Container(
                      padding: EdgeInsets.symmetric(horizontal: gap12),
                      child: Text(
                        '他们飞奔灭火的样子很帅！点赞中国好司机',
                        overflow: TextOverflow.ellipsis,
                        maxLines: 1,
                        style: pfSCStyle(
                            color: ColorsUtil.white, fontSize: font15),
                      ),
                    ),
                  )
                ],
              ),
            ),
            SizedBox(
              height: gap10,
            ),
            Row(
              children: [
                Text(
                  '央广网',
                  style: pfMediumStyle(
                      color: ColorsUtil.content, fontSize: font12),
                ),
                SizedBox(
                  width: gap10,
                ),
                Text(
                  md.createTimeStr,
                  style: pfMediumStyle(
                      color: ColorsUtil.content, fontSize: font12),
                ),
                SizedBox(
                  width: gap10,
                ),
                Text(
                  '9999次浏览',
                  style: pfMediumStyle(
                      color: ColorsUtil.content, fontSize: font12),
                ),
              ],
            )
          ],
        ),
      ),
    );
  }
}
